package org.ssh.dao.impl;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.criterion.Restrictions;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;


import org.ssh.dao.IPurchasenoteDao;
import org.ssh.pojo.Asset;
import org.ssh.pojo.Purchasenote;
import org.ssh.pojo.Scrap;

public class PurchasenoteDao extends BaseDao implements IPurchasenoteDao{

	public int change(Purchasenote purchasenote) {
		// TODO Auto-generated method stub
		try {
			getHibernateTemplate().saveOrUpdate(purchasenote);
			//getHibernateTemplate().saveOrUpdate(asset);
			return 1;
			
		} catch (Exception e) {
			// TODO: handle exception
		}
		return 0;
	}

	
//	public int saveasset(Asset asset) {
//		// TODO Auto-generated method stub
//		try {
//			
//			getHibernateTemplate().saveOrUpdate(asset);
//			return 1;
//		} catch (Exception e) {
//			// TODO: handle exception
//			e.printStackTrace();
//		}
//		return 0;
//	}
	}
